<?
/**
 * Display confirmation message after resetting a password.
 */
(basename($_SERVER['PHP_SELF']) == basename(__FILE__)) && die('Access Denied');

// title
$this->setTitle(WEB_APP_NAME . ' : ' . OPT_PASS . ' Results');

// validate required template variables
$item = $this->getVar('item');
if (!($item instanceof User)) {
	die($this->getPageError('User instance is missing.'));
	}

/**
 * Are there errors?
 */
$hasErrors = (is_array($this->getErrors()) and count($this->getErrors()));
$canDel = ($item->canDelete() && (getUserId() !== $item->Id()));

// generate boilerplate html
$class = '';
$this->addJs('js/menu.js');
?>
<?= $this->getPageHeader(); ?>
<? if ($hasErrors) { ?>
<div id="container-error">
<?= implode('<br />', $this->getErrors()); ?>
</div>
<? } ?>

<div align="center">
<div id="page-container">
<div id="container-medium">
<?= getMenuBars(OPT_VIEW, $canDel); ?>
</div> <!-- container-medium -->

<div id="container-small">
<div class="content-view">
Congratulations, the password has been reset. Please make note of the
temporary password:
<p align="center">
<code><?= htmlspecialchars($this->getVar('tmpPass')); ?></code>
</p>

</div> <!-- content-view -->
</div> <!-- container-small -->

</div> <!-- page-container -->
</div> <!-- center -->
<?= $this->getPageFooter(); ?>
